#define  _CRT_SECURE_NO_WARNINGS 1

#include "MyStack.h"

void TestQueue()
{
	Queue Qu;
	QueueInit(&Qu);

	QueuePush(&Qu, 1);
	QueuePush(&Qu, 2);
	QueuePush(&Qu, 3);
	QueuePush(&Qu, 4);
	QueuePush(&Qu, 5);
	QueuePush(&Qu, 6);

	printf("QueueSize: %d\n", QueueSize(&Qu));
	printf("QueueFront: %d\n", QueueFront(&Qu));
	printf("QueueBack: %d\n", QueueBack(&Qu));

	while (!QueueEmpty(&Qu))
	{
		printf("%d ", QueueFront(&Qu));
		QueuePop(&Qu);
	}
	printf("\n");

	printf("QueueSize: %d\n", QueueSize(&Qu));
	QueuePush(&Qu, 50);

	printf("QueueSize: %d\n", QueueSize(&Qu));
	printf("QueueFront: %d\n", QueueFront(&Qu));
	printf("QueueBack: %d\n", QueueBack(&Qu));
}

void TestMyStack()
{
	MyStack St;
	MyStackInit(&St);
	
	MyStackPush(&St, 1);
	MyStackPush(&St, 2);
	MyStackPush(&St, 3);
	MyStackPush(&St, 4);
	MyStackPush(&St, 5);
	MyStackPush(&St, 6);

	printf("MyStackSize: %d\n", MyStackSize(&St));
	printf("MyStackTop: %d\n", MyStackTop(&St));

	while (!MyStackEmpty(&St))
	{
		printf("%d ", MyStackTop(&St));
		MyStackPop(&St);
	}
	printf("\n");

	printf("MyStackSize: %d\n", MyStackSize(&St));
	MyStackPush(&St, 50);

	printf("QueueSize: %d\n", QueueSize(&St));
	printf("%d\n", MyStackTop(&St));
}

int main()
{
	//TestQueue();
	TestMyStack();

	return 0;
}